package com.dm.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dm.server.entity.Blog;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
public interface BlogMapper extends BaseMapper<Blog> {
    @Update("UPDATE blog SET liked = liked + #{count} WHERE id = #{blogId}")
    void incrementLikeCount(@Param("blogId") Long blogId, @Param("count") int count);
}
